<!DOCTYPE html>












  


<html class="theme-next pisces use-motion" lang="zh-CN">
<head><meta name="generator" content="Hexo 3.9.0">
  <meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">












  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png?v=7.2.0">


  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png?v=7.2.0">


  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png?v=7.2.0">


  <link rel="mask-icon" href="/images/logo.svg?v=7.2.0" color="#222">






<link rel="stylesheet" href="/css/main.css?v=7.2.0">






<link rel="stylesheet" href="/lib/font-awesome/css/font-awesome.min.css?v=4.7.0">






  
  
  <link rel="stylesheet" href="/lib/fancybox/source/jquery.fancybox.css">



<script id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Pisces',
    version: '7.2.0',
    sidebar: {"position":"left","display":"post","offset":12,"onmobile":false},
    back2top: {"enable":true,"sidebar":false,"scrollpercent":true},
    copycode: {"enable":true,"show_result":true,"style":null},
    fancybox: true,
    mediumzoom: false,
    lazyload: false,
    pangu: false,
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    },
    localsearch: {"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},
    search: {
      root: '/',
      path: 'search.xml'
    },
    tabs: true,
    motion: {"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},
    translation: {
      copy_button: '复制',
      copy_success: '复制成功',
      copy_failure: '复制失败'
    }
  };
</script>

  <meta name="description" content="DLL介绍DLL(Dynamic Link Library)文件为动态链接库文件，又称”应用程序拓展”，是软件文件类型。在Windows中，许多应用程序并不是一个完整的可执行文件，它们被分割成一些相对独立的动态链接库，即DLL文件，放置于系统中。当我们执行某一个程序时，相应的DLL文件就会被调用。一个应用程序可使用多个DLL文件，一个DLL文件也可能被不同的应用程序使用，这样的DLL文件被称为共享">
<meta name="keywords" content="node,dll">
<meta property="og:type" content="article">
<meta property="og:title" content="node-dll 调用">
<meta property="og:url" content="https://blog.youngzk.com/posts/cf777cb3/index.html">
<meta property="og:site_name" content="Muniz Blog">
<meta property="og:description" content="DLL介绍DLL(Dynamic Link Library)文件为动态链接库文件，又称”应用程序拓展”，是软件文件类型。在Windows中，许多应用程序并不是一个完整的可执行文件，它们被分割成一些相对独立的动态链接库，即DLL文件，放置于系统中。当我们执行某一个程序时，相应的DLL文件就会被调用。一个应用程序可使用多个DLL文件，一个DLL文件也可能被不同的应用程序使用，这样的DLL文件被称为共享">
<meta property="og:locale" content="zh-CN">
<meta property="og:image" content="https://blog.youngzk.com/posts/cf777cb3/node-dll-1.png">
<meta property="og:image" content="https://blog.youngzk.com/posts/cf777cb3/node-dll-2.png">
<meta property="og:image" content="https://blog.youngzk.com/posts/cf777cb3/node-dll-4.png">
<meta property="og:image" content="https://blog.youngzk.com/posts/cf777cb3/node-dll-5.png">
<meta property="og:image" content="https://blog.youngzk.com/posts/cf777cb3/node-dll-6.png">
<meta property="og:image" content="https://blog.youngzk.com/posts/cf777cb3/node-dll-7.png">
<meta property="og:updated_time" content="2019-07-28T05:22:54.715Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="node-dll 调用">
<meta name="twitter:description" content="DLL介绍DLL(Dynamic Link Library)文件为动态链接库文件，又称”应用程序拓展”，是软件文件类型。在Windows中，许多应用程序并不是一个完整的可执行文件，它们被分割成一些相对独立的动态链接库，即DLL文件，放置于系统中。当我们执行某一个程序时，相应的DLL文件就会被调用。一个应用程序可使用多个DLL文件，一个DLL文件也可能被不同的应用程序使用，这样的DLL文件被称为共享">
<meta name="twitter:image" content="https://blog.youngzk.com/posts/cf777cb3/node-dll-1.png">





  
  
  <link rel="canonical" href="https://blog.youngzk.com/posts/cf777cb3/">



<script id="page.configurations">
  CONFIG.page = {
    sidebar: "",
  };
</script>

  
  <title>node-dll 调用 | Muniz Blog</title>
  






  <script>
    var _hmt = _hmt || [];
    (function() {
      var hm = document.createElement("script");
      hm.src = "https://hm.baidu.com/hm.js?502753d7b083822cd84ffc61132a5ac4";
      var s = document.getElementsByTagName("script")[0];
      s.parentNode.insertBefore(hm, s);
    })();
  </script>







  <noscript>
  <style>
  .use-motion .motion-element,
  .use-motion .brand,
  .use-motion .menu-item,
  .sidebar-inner,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-title { opacity: initial; }

  .use-motion .logo,
  .use-motion .site-title,
  .use-motion .site-subtitle {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line-before i { left: initial; }
  .use-motion .logo-line-after i { right: initial; }
  </style>
</noscript>

</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-CN">

  
  
    
  

  <div class="container sidebar-position-left page-post-detail">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta">
    

    <div class="custom-logo-site-title">
      <a href="/" class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">Muniz Blog</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
    
    
  </div>

  <div class="site-nav-toggle">
    <button aria-label="切换导航栏">
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>



<nav class="site-nav">
  
    <ul id="menu" class="menu">
      
        
        
        
          
          <li class="menu-item menu-item-home">

    
    
      
    

    

    <a href="/" rel="section"><i class="menu-item-icon fa fa-fw fa-home"></i> <br>首页</a>

  </li>
        
        
        
          
          <li class="menu-item menu-item-books">

    
    
      
    

    

    <a href="/books" rel="section"><i class="menu-item-icon fa fa-fw fa-question-circle"></i> <br>阅读</a>

  </li>
        
        
        
          
          <li class="menu-item menu-item-tags">

    
    
      
    

    

    <a href="/tags/" rel="section"><i class="menu-item-icon fa fa-fw fa-tags"></i> <br>标签</a>

  </li>
        
        
        
          
          <li class="menu-item menu-item-categories">

    
    
      
    

    

    <a href="/categories/" rel="section"><i class="menu-item-icon fa fa-fw fa-th"></i> <br>分类</a>

  </li>
        
        
        
          
          <li class="menu-item menu-item-archives">

    
    
      
    

    

    <a href="/archives/" rel="section"><i class="menu-item-icon fa fa-fw fa-archive"></i> <br>归档</a>

  </li>

      
      
        <li class="menu-item menu-item-search">
          <a href="javascript:;" class="popup-trigger">
          
            <i class="menu-item-icon fa fa-search fa-fw"></i> <br>搜索</a>
        </li>
      
    </ul>
  

  

  
    <div class="site-search">
      
  <div class="popup search-popup local-search-popup">
  <div class="local-search-header clearfix">
    <span class="search-icon">
      <i class="fa fa-search"></i>
    </span>
    <span class="popup-btn-close">
      <i class="fa fa-times-circle"></i>
    </span>
    <div class="local-search-input-wrapper">
      <input autocomplete="off" placeholder="搜索..." spellcheck="false" type="text" id="local-search-input">
    </div>
  </div>
  <div id="local-search-result"></div>
</div>



    </div>
  
</nav>



</div>
    </header>

    


    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          
            

          
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
      

  
  
  

  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="https://blog.youngzk.com/posts/cf777cb3/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="修心">
      <meta itemprop="description" content="修不被别人影响的心，修不被自己控制的心，修不被别人诱惑的心。">
      <meta itemprop="image" content="/images/avatar.jpg">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Muniz Blog">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">node-dll 调用

              
            
          </h1>
        

        <div class="post-meta">

          
          
          

          
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              

              
                
              

              <time title="创建时间：2018-08-26 08:56:42" itemprop="dateCreated datePublished" datetime="2018-08-26T08:56:42+08:00">2018-08-26</time>
            </span>
          

          
            

            
              <span class="post-meta-item">
                <span class="post-meta-item-icon">
                  <i class="fa fa-calendar-check-o"></i>
                </span>
                
                  <span class="post-meta-item-text">更新于</span>
                
                <time title="修改时间：2019-07-28 13:22:54" itemprop="dateModified" datetime="2019-07-28T13:22:54+08:00">2019-07-28</time>
              </span>
            
          

          

          
          

          
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-eye"></i>
                 阅读次数： 
                <span class="busuanzi-value" id="busuanzi_value_page_pv"></span>
              </span>
            </span>
          

          

          <br>
          

          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        <h3 id="DLL介绍"><a href="#DLL介绍" class="headerlink" title="DLL介绍"></a>DLL介绍</h3><p>DLL(Dynamic Link Library)文件为动态链接库文件，又称”应用程序拓展”，是软件文件类型。在Windows中，许多应用程序并不是一个完整的可执行文件，它们被分割成一些相对独立的动态链接库，即DLL文件，放置于系统中。当我们执行某一个程序时，相应的DLL文件就会被调用。一个应用程序可使用多个DLL文件，一个DLL文件也可能被不同的应用程序使用，这样的DLL文件被称为共享DLL文件。</p>
<h3 id="Node-怎么调用DLL"><a href="#Node-怎么调用DLL" class="headerlink" title="Node 怎么调用DLL"></a>Node 怎么调用DLL</h3><p>使用 node-ffi 模块，非常灵活的node中去调用dll中暴露的方法。</p>
<a id="more"></a>

<h3 id="安装node-ffi模块"><a href="#安装node-ffi模块" class="headerlink" title="安装node-ffi模块"></a>安装node-ffi模块</h3><blockquote>
<p><a href="https://github.com/nodejs/node-gyp" target="_blank" rel="noopener">Node-gyp</a><br><a href="https://github.com/nodejs/node-gyp" target="_blank" rel="noopener">https://github.com/nodejs/node-gyp</a></p>
</blockquote>
<blockquote>
<p><a href="https://github.com/node-ffi/node-ffi" target="_blank" rel="noopener">Node-ffi</a><br><a href="https://github.com/node-ffi/node-ffi" target="_blank" rel="noopener">https://github.com/node-ffi/node-ffi</a></p>
</blockquote>
<blockquote>
<p>安装命令  npm install ffi</p>
</blockquote>
<p>** 在安装node-ffi模块前，必须保证node-gyp 安装成功，并且node-gyp可以使用 **</p>
<h3 id="安装node-ffi-遇到的坑"><a href="#安装node-ffi-遇到的坑" class="headerlink" title="安装node-ffi 遇到的坑"></a>安装node-ffi 遇到的坑</h3><p>如果安装成功了，就看看我是怎么解决这个坑的吧。</p>
<p>不知道是怎么回事，每次安装ffi模块，都会导致 node-gyp build  V8类型出错。</p>
<p>** 解决方法：**<br>直接克隆node-ffi仓库到本地，把node-ffi 放到全局的 node-modules中。</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git <span class="built_in">clone</span> git://github.com/node-ffi/node-ffi.git</span><br></pre></td></tr></table></figure>

<p>再进入CMD命令窗口中，执行** npm install node-ffi –g **,即可成功安装。<br>安装完后，全局的 node-modules中会出现 快捷方式的 ffi文件夹。<br>需要创建一个ffi文件夹，并把快捷方式的 ffi文件夹内容剪切到 新的 ffi文件夹中，也就是去掉快捷方式即可。</p>
<h3 id="开发DLL"><a href="#开发DLL" class="headerlink" title="开发DLL"></a>开发DLL</h3><blockquote>
<p>开发DLL工具，我使用的是VS2015。</p>
</blockquote>
<p>** 步骤：b**</p>
<p>开发DLL工具，我使用的是VS2015。<br>打开** VS2015 ** -&gt; ** 文件 ** -&gt; ** 新建 ** -&gt; ** 项目 ** -&gt; ** 选择Win32控制台应用程序 **</p>
<img src="/posts/cf777cb3/node-dll-1.png" title="创建项目">

<img src="/posts/cf777cb3/node-dll-2.png" title="应用程序向导">

<p>选择 ** 下一步 **</p>


<p>选择 ** 控制台应用程序 空项目 ** 最后点击 ** 完成 **</p>
<img src="/posts/cf777cb3/node-dll-4.png" title="应用程序向导">

<p>右击** nodeFile ** 项目名称，选择 ** 添加 ** -&gt; ** 新建项 **</p>
<img src="/posts/cf777cb3/node-dll-5.png" title="应用程序向导">

<p>选择 ** 头文件 *<em>，名称我写的 *</em> fileChange.h **点击添加</p>
<p>同理，相同的步骤创建C++文件（.cpp），名称fileChange.cpp 点击添加</p>
<p>在源文件 ** fileChange.cpp ** 中编写代码：</p>
<figure class="highlight c++"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">// fileChange.cpp </span></span><br><span class="line"></span><br><span class="line"><span class="meta">#<span class="meta-keyword">include</span> <span class="meta-string">"fileChange.h"</span></span></span><br><span class="line">	</span><br><span class="line">	<span class="comment">//同步函数，求和方法</span></span><br><span class="line"><span class="function"><span class="keyword">int</span> <span class="title">add</span><span class="params">(<span class="keyword">int</span> i, <span class="keyword">int</span> j)</span> </span>&#123;</span><br><span class="line">		<span class="keyword">return</span> i + j;</span><br><span class="line">&#125;</span><br><span class="line">	<span class="comment">//异步函数，求和方法</span></span><br><span class="line"><span class="function"><span class="keyword">int</span> <span class="title">addSync</span><span class="params">(<span class="keyword">int</span> i, <span class="keyword">int</span> j, <span class="keyword">void</span> (*callfuct)(<span class="keyword">int</span> a, <span class="keyword">int</span> b))</span> </span>&#123;</span><br><span class="line">		<span class="keyword">int</span> sum = i + j;</span><br><span class="line">		callfuct(sum, j);</span><br><span class="line">		<span class="keyword">return</span> <span class="number">0</span>;</span><br></pre></td></tr></table></figure>

<p>在头文件 ** fileChange.h ** 中编写代码：</p>
<figure class="highlight c++"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">//  fileChange.h</span></span><br><span class="line"></span><br><span class="line"><span class="meta">#<span class="meta-keyword">pragma</span> once</span></span><br><span class="line"><span class="keyword">extern</span> <span class="string">"C"</span> __declspec(dllexport) <span class="function"><span class="keyword">int</span> <span class="title">add</span><span class="params">(<span class="keyword">int</span> i, <span class="keyword">int</span> j)</span></span>;</span><br><span class="line"><span class="keyword">extern</span> <span class="string">"C"</span> __declspec(dllexport) <span class="function"><span class="keyword">int</span> <span class="title">addSync</span><span class="params">(<span class="keyword">int</span> i, <span class="keyword">int</span> j, <span class="keyword">void</span> (*callfuct)(<span class="keyword">int</span> a, <span class="keyword">int</span> b))</span></span>;</span><br></pre></td></tr></table></figure>

<p>在这里必须使用，** extern “C” ** 让编译器使用C解析方法去导出DLL，不然node-ffi模块识别不了。</p>
<h3 id="生成DLL"><a href="#生成DLL" class="headerlink" title="生成DLL"></a>生成DLL</h3><p>因为我的电脑环境是64位，node也是64位，所以我导出的dll也需要是64位，不然node-ffi也是调用不成功。</p>
<p>** 导出方法： **</p>
<img src="/posts/cf777cb3/node-dll-6.png" title="导出方法">

<p>导出的dll文件在在项目目录下的 \x64\Debug 中，即可找到 nodeFile.dll动态链接库文件。</p>
<img src="/posts/cf777cb3/node-dll-7.png" title="应用程序向导">

<h3 id="node使用DLL"><a href="#node使用DLL" class="headerlink" title="node使用DLL"></a>node使用DLL</h3><figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">//导入ffi模块</span></span><br><span class="line"><span class="keyword">var</span> ffi = <span class="built_in">require</span>(<span class="string">'ffi'</span>);</span><br><span class="line"><span class="comment">//使用ffi.Library加载dll, 第一个参赛是库文件路径，第二个参数是JSON格式，用于定义使用的dll方法。</span></span><br><span class="line"><span class="comment">//int 表示整形，pointer 表示 指针地址，也可以使用 int * 表示。</span></span><br><span class="line"><span class="keyword">var</span> libm = ffi.Library(<span class="string">'./../dll/nodeFlie'</span>, &#123;</span><br><span class="line">  <span class="string">'add'</span>: [ <span class="string">'int'</span>, [ <span class="string">'int'</span>,<span class="string">'int'</span> ] ],</span><br><span class="line">  <span class="string">'addSync'</span>: [<span class="string">'int'</span>, [<span class="string">'int'</span>,<span class="string">'int'</span>,<span class="string">'pointer'</span>]]</span><br><span class="line">&#125;);</span><br><span class="line"></span><br><span class="line"><span class="comment">//调用方法</span></span><br><span class="line"><span class="keyword">const</span> sum = libm.add(<span class="number">1</span>,<span class="number">5</span>);</span><br><span class="line"><span class="built_in">console</span>.log(sum);</span><br><span class="line"></span><br><span class="line"><span class="comment">//定义 回调函数</span></span><br><span class="line"><span class="keyword">let</span> addCallback = ffi.Callback(<span class="string">'void'</span>, [<span class="string">'int'</span>, <span class="string">'int'</span>], (a, b) =&gt; &#123;</span><br><span class="line">  <span class="built_in">console</span>.log(a,b);</span><br><span class="line">&#125;);</span><br><span class="line"></span><br><span class="line"><span class="comment">//执行回调的 dll方法</span></span><br><span class="line">libm.addSync(<span class="number">2</span>,<span class="number">3</span>,addCallback);</span><br><span class="line"></span><br><span class="line">执行结果：</span><br><span class="line"></span><br><span class="line">PS E:\nodejsproject\node-fileChangeAttr\src&gt; node .\index.js</span><br><span class="line"><span class="number">6</span></span><br><span class="line"><span class="number">5</span> <span class="number">3</span></span><br></pre></td></tr></table></figure>
      
    </div>

    
      


    

    
      
    

    
    
    

    

    
      
    
    

    
      <div>
        




  



<ul class="post-copyright">
  <li class="post-copyright-author">
    <strong>本文作者： </strong>修心</li>
  <li class="post-copyright-link">
    <strong>本文链接：</strong>
    
    <a href="https://blog.youngzk.com/posts/cf777cb3/" title="node-dll 调用">https://blog.youngzk.com/posts/cf777cb3/</a>
  </li>
  <li class="post-copyright-license">
    <strong>版权声明： </strong>本博客所有文章除特别声明外，均采用 <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/zh-CN" rel="noopener" target="_blank"><i class="fa fa-fw fa-creative-commons"></i>BY-NC-SA</a> 许可协议。转载请注明出处！</li>
</ul>

      </div>
    

    <footer class="post-footer">
      
        
          
        
        <div class="post-tags">
          
            <a href="/tags/node/" rel="tag"># node</a>
          
            <a href="/tags/dll/" rel="tag"># dll</a>
          
        </div>
      

      
      
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/posts/9f19e967/" rel="next" title="typeScript">
                <i class="fa fa-chevron-left"></i> typeScript
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/posts/7f98c2be/" rel="prev" title="webAssembly">
                webAssembly <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </div>
  
  
  
  </article>

  </div>


          </div>
          
  



        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap">
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview-wrap">
            站点概览
          </li>
        </ul>
      

      <div class="site-overview-wrap sidebar-panel">
        <div class="site-overview">

          <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
  
    <a href="/">
      <img class="site-author-image" itemprop="image" src="/images/avatar.jpg" alt="修心">
      </a>
  
  <p class="site-author-name" itemprop="name">修心</p>
  <div class="site-description motion-element" itemprop="description">修不被别人影响的心，修不被自己控制的心，修不被别人诱惑的心。</div>
</div>


  <nav class="site-state motion-element">
    
      <div class="site-state-item site-state-posts">
        
          <a href="/archives/">
        
          <span class="site-state-item-count">17</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
    

    
      
      
      <div class="site-state-item site-state-categories">
        
          
            <a href="/categories/">
          
        
        
        
          
        
          
        
          
        
        <span class="site-state-item-count">3</span>
        <span class="site-state-item-name">分类</span>
        </a>
      </div>
    

    
      
      
      <div class="site-state-item site-state-tags">
        
          
            <a href="/tags/">
          
        
        
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
        <span class="site-state-item-count">20</span>
        <span class="site-state-item-name">标签</span>
        </a>
      </div>
    
  </nav>







  <div class="links-of-author motion-element">
    
      <span class="links-of-author-item">
      
      
        
      
      
        
      
        <a href="https://github.com/1160007652" title="GitHub &rarr; https://github.com/1160007652" rel="noopener" target="_blank"><i class="fa fa-fw fa-github"></i>GitHub</a>
      </span>
    
      <span class="links-of-author-item">
      
      
        
      
      
        
      
        <a href="mailto:1160007652@qq.com" title="E-Mail &rarr; mailto:1160007652@qq.com" rel="noopener" target="_blank"><i class="fa fa-fw fa-envelope"></i>E-Mail</a>
      </span>
    
  </div>



  <div class="cc-license motion-element" itemprop="license">
  
  
    
  
  
  
    <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/zh-CN" class="cc-opacity" rel="noopener" target="_blank"><img src="/images/cc-by-nc-sa.svg" alt="Creative Commons"></a>
  </div>





          
          
        </div>
      </div>

      
      <!--noindex-->
        <div class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
            
            
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-3"><a class="nav-link" href="#DLL介绍"><span class="nav-number">1.</span> <span class="nav-text">DLL介绍</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#Node-怎么调用DLL"><span class="nav-number">2.</span> <span class="nav-text">Node 怎么调用DLL</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#安装node-ffi模块"><span class="nav-number">3.</span> <span class="nav-text">安装node-ffi模块</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#安装node-ffi-遇到的坑"><span class="nav-number">4.</span> <span class="nav-text">安装node-ffi 遇到的坑</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#开发DLL"><span class="nav-number">5.</span> <span class="nav-text">开发DLL</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#生成DLL"><span class="nav-number">6.</span> <span class="nav-text">生成DLL</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#node使用DLL"><span class="nav-number">7.</span> <span class="nav-text">node使用DLL</span></a></li></ol></div>
            

          </div>
        </div>
      <!--/noindex-->
      

      

    </div>
  </aside>
  <div id="sidebar-dimmer"></div>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright">&copy; 2018 – <span itemprop="copyrightYear">2019</span>
  <span class="with-love" id="animate">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">修心</span>

  

  
</div>

<div>
  修不被别人影响的心，修不被自己控制的心，修不被别人诱惑的心。
</div>









        
<div class="busuanzi-count">
  <script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>

  
    <span class="post-meta-item-icon">
      <i class="fa fa-user"></i>
    </span>
    <span class="site-uv" title="总访客量">
      <span class="busuanzi-value" id="busuanzi_value_site_uv"></span>
    </span>
  

  
    <span class="post-meta-divider">|</span>
  

  
    <span class="post-meta-item-icon">
      <i class="fa fa-eye"></i>
    </span>
    <span class="site-pv" title="总访问量">
      <span class="busuanzi-value" id="busuanzi_value_site_pv"></span>
    </span>
  
</div>









        
      </div>
    </footer>

    
      <div class="back-to-top">
        <i class="fa fa-arrow-up"></i>
        
          <span id="scrollpercent"><span>0</span>%</span>
        
      </div>
    

    

    

    

  </div>

  

<script>
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>






  











  
  









  
  <script src="/lib/jquery/index.js?v=3.4.1"></script>

  
  <script src="/lib/fancybox/source/jquery.fancybox.pack.js"></script>

  
  <script src="/lib/velocity/velocity.min.js?v=1.2.1"></script>

  
  <script src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>




  <script src="/js/utils.js?v=7.2.0"></script>

  <script src="/js/motion.js?v=7.2.0"></script>



  
  


  <script src="/js/affix.js?v=7.2.0"></script>

  <script src="/js/schemes/pisces.js?v=7.2.0"></script>



  
  <script src="/js/scrollspy.js?v=7.2.0"></script>
<script src="/js/post-details.js?v=7.2.0"></script>



  <script src="/js/next-boot.js?v=7.2.0"></script>

  

  

  


  













  <script src="/js/local-search.js?v=7.2.0"></script>












<script>
// GET RESPONSIVE HEIGHT PASSED FROM IFRAME

window.addEventListener("message", function(e) {
  var data = e.data;
  if ((typeof data === 'string') && (data.indexOf('ciu_embed') > -1)) {
    var featureID = data.split(':')[1];
    var height = data.split(':')[2];
    $(`iframe[data-feature=${featureID}]`).height(parseInt(height) + 30);
  }
}, false);
</script>








  

<script src="/live2dw/lib/L2Dwidget.min.js?094cbace49a39548bed64abff5988b05"></script><script>L2Dwidget.init({"pluginRootPath":"live2dw/","pluginJsPath":"lib/","pluginModelPath":"assets/","tagMode":false,"debug":false,"model":{"jsonPath":"/live2dw/assets/hijiki.model.json"},"display":{"position":"right","width":150,"height":300},"mobile":{"show":true},"react":{"opacity":0.7},"log":false});</script></body>
</html>
